local jianzhiselect = fk.CreateSkill({
  name = "jianzhi_select",
})

Fk:loadTranslationTable{
  ["jianzhi_select"] = "剑制",
}

jianzhiselect:addEffect("active", {
  expand_pile = function (self, player)
    local cards = Fk:currentRoom().discard_pile
      return table.filter(cards, function(id)
        return Fk:getCardById(id).sub_type == Card.SubtypeWeapon
      end)
  end,
  can_use = Util.FalseFunc,
  target_num = 0,
  card_num = 1,
  card_filter = function(self, player, to_select, selected)
    if #selected ~= 0 then return false end
    local card = Fk:getCardById(to_select)
        if card.sub_type ~= Card.SubtypeWeapon 
    then
      return
    end
    return card.sub_type == Card.SubtypeWeapon and not table.contains(player:getCardIds("e"), to_select) and not table.contains(player:getCardIds("h"), to_select) and
      Fk:currentRoom():getPlayerById(self.jianzhi_target):canMoveCardIntoEquip(to_select, false)
  end,
})

return jianzhiselect